package nl.weeaboo.sh.objects;

import nl.weeaboo.game.gl.GLManager;
import nl.weeaboo.game.input.UserInput;
import nl.weeaboo.sh.Game;
import nl.weeaboo.sh.level.Level;

public abstract class Effect {

	private boolean destroyed;
	
	protected Game game;
	protected Level level;
	
	public Effect(Game game, Level level) {
		this.game = game;
		this.level = level;
	}
	
	//Functions
	public final void dispose() {
		onDisposed();
		level.removeEffect(this);		
	}
	protected void onDisposed() {		
	}
	public void destroy() {
		destroyed = true;
	}
	
	public abstract void update(UserInput input, float dt);
	public abstract void drawBackground(GLManager glm);
	public abstract void drawForeground(GLManager glm);
	
	//Getters
	public final boolean isDestroyed() { return destroyed; }
	
	//Setters
	
}
